package com.lenin.metro.shared;

import java.io.Serializable;

import javax.persistence.Id;

import com.googlecode.objectify.annotation.Unindexed;

@Unindexed
public class TileGroup implements Serializable {
	
	private Tile[][] tileData;
	private int horizontalLength;
	private int verticalLength;
	private int tileSize;
	
	@Id
	String id;
	
	
	public TileGroup() {
	}
	
	public TileGroup(MapCoordinates coordinates) {
		this.id = coordinates.getLatitude()+","+coordinates.getLongitude();
	}
	
	public Tile[][] getTileData() {
		return tileData;
	}

	public void setTileData(Tile[][] tileData) {
		this.tileData = tileData;
	}

	
	public int getHorizontalLength() {
		return horizontalLength;
	}


	public void setHorizontalLength(int horizontalLength) {
		this.horizontalLength = horizontalLength;
	}


	public int getVerticalLength() {
		return verticalLength;
	}


	public void setVerticalLength(int verticalLength) {
		this.verticalLength = verticalLength;
	}


	public int getTileSize() {
		return tileSize;
	}


	public void setTileSize(int tileSize) {
		this.tileSize = tileSize;
	}


	public String getId() {
		return id;
	}
	
	public MapCoordinates getCoordinates() {
		
		String[] latLngStr = id.split(",");
		
		return new MapCoordinates(Long.parseLong(latLngStr[0]), Long.parseLong(latLngStr[1]));
	
	}
		

}
